//
// Created by zeng on 2021/10/15.
//

#ifndef SENDEMAIL_GETWEATHER_H
#define SENDEMAIL_GETWEATHER_H

#define CPPHTTPLIB_OPENSSL_SUPPORT

#include <string>
#include "../Lib/nlohmann/json.hpp"
#include "../Lib/httplib.h"
#include "../Entity/JsonParsedString.h"
#include "../Entity/Weather.h"
#include "../Entity/Tip.h"
#include "../Entity/Warn.h"

using json = nlohmann::json;

class GetWeather {
private:
    std::string location;
    std::string ID;
    std::string key;
    static httplib::Client cli;
    static httplib::Client cli_ID;
public:
    GetWeather(std::string location);

    std::string get_ID();

    JsonParsedString get_weather_JsonParsedString();

    JsonParsedString get_tip_JsonParsedString();

    JsonParsedString get_warn_JsonParsedString();

    Weather get_weather();

    Tip get_tip();

    Warn get_warn();

//    JsonParsedString get_warn_JsonParsedString();
};


#endif //SENDEMAIL_GETWEATHER_H
